package cn.itcast.manytomany;

import cn.itcast.jopo.Student;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {
    @Select("select * from student")
    @Results({
            @Result(id=true,column ="id",property = "id"),
            @Result(column = "name", property = "name"),
            @Result(column = "age",property = "age"),
            @Result(property = "list", many=@Many(select =
                    "cn.itcast.manytomany.CourseMapper.findAll"),column = "id")

    })

    public List<Student> select();
}
